/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.suli.location.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.io.Serializable;
import java.sql.Timestamp;

/**
* @website https://eladmin.vip
* @description /
* @author WYH
* @date 2024-02-05
**/
@Entity
@Data
@Table(name="location")
public class Location implements Serializable {

    @Id
    @Column(name = "`id`")
    @ApiModelProperty(value = "ID")
    private Long id;

    @Column(name = "`create_by`")
    @ApiModelProperty(value = "创建用户")
    private String createBy;

    @Column(name = "`update_by`")
    @ApiModelProperty(value = "修改用户")
    private String updateBy;

    @Column(name = "`create_time`")
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "`update_time`")
    @ApiModelProperty(value = "修改日期")
    private Timestamp updateTime;

    @Column(name = "`status`")
    @ApiModelProperty(value = "是否占用")
    private Integer status;

    @Column(name = "`location_code`")
    @ApiModelProperty(value = "库位号")
    private String locationCode;

    @Column(name = "`warehouse_code`")
    @ApiModelProperty(value = "所属仓库")
    private String warehouseCode;

    @Column(name = "`location_admin`")
    @ApiModelProperty(value = "库位管理员")
    private String locationAdmin;

    @Column(name = "`remark`")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "`row`")
    @ApiModelProperty(value = "排")
    private Integer row;

    @Column(name = "`column`")
    @ApiModelProperty(value = "列")
    private Integer column;

    @Column(name = "`layer`")
    @ApiModelProperty(value = "层")
    private Integer layer;

    @Column(name = "`type`")
    @ApiModelProperty(value = "枯萎类型")
    private Integer type;

    @Column(name = "`body_position`")
    @ApiModelProperty(value = "身位")
    private String bodyPosition;

    @Column(name = "`tray_code`")
    @ApiModelProperty(value = "身位")
    private String trayCode;

    public void copy(Location source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
